package com.easy.facilitaterecycleadapter;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.easy.facilitaterecycleadapter.adapter.OnLoadMoreListener;
import com.easy.facilitaterecycleadapter.adapter.OnRefreshListener;
import com.easy.facilitaterecycleadapter.adapter.TestAdapter;

import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

public class Main2Activity extends AppCompatActivity {
    private View mRefreshView,mLoaderView;
    private List<Integer> list =new ArrayList<>();
    private RecyclerView mRecycView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        initData();
        mRecycView = (RecyclerView) findViewById(R.id.recyc_view);
        LinearLayoutManager gridLayoutManager = new LinearLayoutManager(Main2Activity.this);

        mRecycView.setLayoutManager(gridLayoutManager);
        TestAdapter testAdapter = new TestAdapter(list, Main2Activity.this, R.layout.base_item_layout);
        mRecycView.setAdapter(testAdapter);
    }

    private void initData() {
        for(int x=0;x<20;x++){
            list.add(x);
        }
    }
}
